namespace BM.Tools.WebControls.MForm.Navigation.XPath.NodeTests
{
    /// <summary>
    /// A definition of a node test that matches all children nodes with the specified local name.
    /// </summary>
    public class AllWithLocalNameTest : NodeTest
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AllWithLocalNameTest"/> class. 
        /// </summary>
        /// <param name="localName">
        /// The local name.
        /// </param>
        public AllWithLocalNameTest(string localName)
        {
            LocalName = localName;
        }

        /// <summary>
        /// Gets or sets LocalName.
        /// </summary>
        /// <value>
        /// The local name.
        /// </value>
        public string LocalName
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the text representation of the node test.
        /// </summary>
        /// <value>
        /// The text in which the node test can be represented in xpath - *:(local name).
        /// </value>
        public override string Text
        {
            get
            {
                return string.Concat("*:", LocalName);
            }
        }
    }
}